-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ensureLink/ensureLinkSync for fs #353
Conversation
const destFilePathType = getFileInfoType(destStatInfo); | ||
if (destFilePathType !== PathType.file) { | ||
throw new Error( | ||
`Ensure path exists, expected 'file', got '${destFilePathType}'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard links don't have a specific type, so we can only use it as file.
fs/ensure_link.ts
Outdated
* Ensures that the hard link exists. | ||
* If the directory structure does not exist, it is created. | ||
* | ||
* @param src the source file path. directory are not allow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard link does not support for the directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a TODO and/or issue for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the system not support. This is not possible.
https://askubuntu.com/questions/210741/why-are-hard-links-not-allowed-for-directories
So I think todo is meaningless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. I didn’t know that.
Please change “directory are not allow” to “Directory hard links are not allowed”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. I didn’t know that.
Please change “directory are not allow” to “Directory hard links are not allowed”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
part of #261.
ref: #268.